<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Window Open</title>
  <script type="text/javascript">
    function popUp(url) {
      window.open(url, "popup", "width=320, height=480");
    }
  </script>
</head>
<body>
  <!-- Bad Approach -->
  <a href="javascript:popUp('http://www.baidu.com');">Example</a>
</body>
</html>
